// import { createRouter, createWebHashHistory } from 'vue-router' gi 不支持自动引入 ，在vite.config.js中手动引入，
//在tsconfig.json中，增加"types": ["vite-plugin-vue-layouts/client", "vite-plugin-pages/client"],否则下两行报红。
// import { setupLayouts } from 'virtual:generated-layouts'; //将route里面的路由变成嵌套路由
// import generatedRoutes from 'virtual:generated-pages';

// const routes = setupLayouts(generatedRoutes);
// console.log(routes);
// 导入菜单路由
import { menuRouter } from './menuRouter'

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: () => import('@/layout/SwitchIndex.vue'),
    redirect: '/',
    children: [
      {
        path: '/',
        name: 'HomePage',
        meta: {
          title: 'TOOLSDOG'
        },
        component: () => import('@/views/HomePage.vue')
      },
      //使用菜单路由
      ...menuRouter
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})
export default router
